﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Krile.Kernel.Data;

namespace Krile.Data
{
    internal class XStatus
    {
        public Status BaseStatus;
        public XStatus(Status baseStatus)
        {
            BaseStatus = baseStatus;
        }

        private bool _unread = true;
        internal bool Unread
        {
            get
            {
                if (!Core.Config.Timeline.ManageReadFlags || (Core.Config.Timeline.AutoRemoveNewest && (DateTime.Now - BaseStatus.CreatedAt).TotalSeconds > Core.Config.Timeline.AutoRemoveNewestSec))
                    return false;
                return _unread;
            }
            set { _unread = value; }
        }

        public static explicit operator Status(XStatus xs)
        {
            return xs.BaseStatus;
        }
    }
}
